#include "TcpServer.hpp"
#include <iostream>
#include <memory>

void Usage(std::string proc)
{
    std::cout << "\nUsage:\t" << proc << " port[1024+]\n"
              << std::endl;
}

//./tcpserver localport
int main(int argc, char *argv[])
{
    if (argc != 2)
    {
        Usage(argv[0]);
        exit(2);
    }
    uint16_t port = std::stoi(argv[1]);
    log.Enable(Classfile); // 日志向文件写
    // std::unique_ptr<TcpServer> tcpSvr(new TcpServer(port,"127.0.0.1"));
    std::unique_ptr<TcpServer> tcpSvr(new TcpServer(port));
    tcpSvr->InitServer();
    tcpSvr->Start();

    return 0;
}
